package com.cea.papyrus.diagram.sequence.helper;

import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Interaction;

import com.cea.papyrus.core.helper.NodeHelper;
import com.cea.papyrus.core.utils.Debug;
import com.cea.papyrus.diagraminterchange2.di2.GraphElement;
import com.cea.papyrus.diagraminterchange2.di2.GraphNode;

/**
 * Factory that can create and delete {@link org.eclipse.uml2.uml.ExecutionSpecification}s.
 * 
 */
public class NodeExecutionSpecificationHelper extends NodeHelper {

    @Override
    public GraphNode createGraphElement(Element umlChild, GraphElement parent, Point location,
            Dimension size) {
        Debug.debug(this, "Call NodeExecutionSpecificationHelper.createGraphElement() -- Not implemented", channel); //$NON-NLS-1$
		return null;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.cea.papyrus.common.factories.NodeFactory#canExecute(com.cea.papyrus.diagraminterchange2.di2.GraphNode)
     */
    @Override
    public boolean canCreateGraphElement(GraphElement parent) {
        Debug.debug(this, "Call NodeExecutionSpecificationHelper.canCreateGraphElement() -- Not implemented", channel); //$NON-NLS-1$
		return false;
    }

    // /////////////////////////////////////////////////////////////////////////
    // UML Management
    // /////////////////////////////////////////////////////////////////////////

    /*
     * (non-Javadoc)
     * 
     * @see com.cea.papyrus.common.factories.NodeFactory#createElement(java.lang.String,
     *      org.eclipse.uml2.uml.Element)
     */
    @Override
    public org.eclipse.uml2.uml.Element createUMLElement(String name,
            org.eclipse.uml2.uml.Element umlParent) {
        Debug.debug(this, "Call NodeExecutionSpecificationHelper.createUMLElement() -- Not implemented", channel); //$NON-NLS-1$
        return null;
    }

    @Override
    public boolean canCreateUMLElement(Element umlParent) {
        Debug.debug(this, "Call NodeExecutionSpecificationHelper.canCreateUMLElement()", channel); //$NON-NLS-1$
        if (umlParent instanceof Interaction) {
            return true;
        }
        return false;
    }

    @SuppressWarnings("unchecked")
    @Override
    public boolean addUMLElement(Element element, Element umlParent) {
        Debug.debug(this, "Call NodeExecutionSpecificationHelper.addUMLElement() -- Not implemented", channel); //$NON-NLS-1$
        return false;
    }

    @Override
    public boolean removeUMLElement(Element element, Element umlParent) {
        Debug.debug(this, "Call NodeExecutionSpecificationHelper.removeUMLElement() -- Not implemented", channel); //$NON-NLS-1$
        return false;
    }

    @Override
    public String getBaseString() {
        return "ExecSpec_"; //$NON-NLS-1$
    }

    @Override
    public void setGraphElementPreferences(GraphElement graphElement) {
        Debug.debug(this, "Call NodeExecutionSpecificationHelper.setGraphElementPreferences()", channel); //$NON-NLS-1$
    }
}
